package com.changdu.seatunnel.admin.config.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;

@Getter
public enum SyncKafkaSchemaStatus {
	
    COMMITED(1, "已提交"),
    MODIFY(2, "已变更"),
    PENDING(3, "等待提交");

    @EnumValue
    private final int code;
    private final String description;

    SyncKafkaSchemaStatus(int code, String description) {
        this.code = code;
        this.description = description;
    }

	public static SyncKafkaSchemaStatus fromCode(int code) {
		for (SyncKafkaSchemaStatus status : SyncKafkaSchemaStatus.values()) {
			if (status.code == code) {
				return status;
			}
		}
		throw new IllegalArgumentException("Unknown code: " + code);
	}
}